<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $this->title;?></title>
<link rel="stylesheet" href="<?php echo $this->baseUrl;?>/files/admin/css/main.css" />
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/jquery.js"></script>
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/load.js"></script>
<!--时间选择器-->
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/date/calendar.js"></script>
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/date/lang/cn_utf8.js"></script>
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/date/calendar-setup.js"></script>
<link rel="stylesheet" href="<?php echo $this->baseUrl;?>/files/admin/js/date/calendar-blue.css" />
<!--colorbox-->
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/colorbox.jquery/jquery.colorbox.js"></script>
<link href="<?php echo $this->baseUrl;?>/files/admin/js/colorbox.jquery/colorbox2.css" rel="stylesheet" type="text/css"/>

<style>
.subject{white-space:nowrap;}
.del{ text-decoration: line-through; color:red;}
.green{ color:#00CC33;}
</style>
</head>

<body>
	<div id="main">
		<div id="topMenu">
			<div id="navigation">当前位置：<a href="<?php echo $this->projectUrl(array('action'=>'list'));?>">分支协议列表</a>&gt;<span id="focus">[<?php echo $this->row['childVersion'];?>]协议详情</span></div>
			<div id="topOtherMenu">
			</div>
		</div>
		<div id="body">
			<div id="search">
			</div>
			<div id="content" style="padding-top:5px;">
				<!--content start-->
				<div class="d-title">
				<a onclick="showData(1)" id="title-1" class="on" style="cursor:pointer;">事件列表</a>
				<?php if($this->row['mainVersion']=='V2.0'){?>
				<a onclick="showData(2)" id="title-2" style="cursor:pointer;">页面Id</a> 
				<a onclick="showData(3)" id="title-3" style="cursor:pointer;">操作Id</a> 
				<?php }else{?>
				<a onclick="showData(4)" id="title-4" style="cursor:pointer;">页面ID</a> 
				<?php }?>
				<a style="background:none; text-decoration:none; padding-left:50px;">当前是否埋点[筛选]：
				<select name="isUserNow" id="isUserNow" onchange="setShowData()">
				    <option value="all">all</option>
					<option value="yes">yes</option>
					<option value="no">no</option>
				</select></a>
				<div  style="clear:both;"></div>
				</div>
				<span class="d-line"></span>
				<div class="bi-data-tab" id="data-1">
				<?php 	if(count($this->eventRows)>0){?>
						<table class="table reportTable">
						<tr class="subject">
							<td>事件ID&nbsp;&nbsp;</td>
							<td>事件名称</td>
							<td>事件实现方式</td>
							<td>上传方式</td>
							<td>事件生成时机</td>
							<td>备注</td>
						</tr>
						<?php foreach ($this->eventRows as $row){?>
						<tr>
							<td><?php echo !empty($row['eventId']) ? $row['eventId'] : '&nbsp;';?></td>
							<td><?php echo !empty($row['eventName']) ? $row['eventName'] : '&nbsp;';?></td>
							<td>
							<?php 
								if ($row['eventComplyMode']==0){
									echo "SDK";
								} else if ($row['eventComplyMode']==1){
									echo "APP";
								} else{
									echo "未知";
								}
							?>
							</td>
							<td>
							<?php switch ($row['eventUploadMode']) {
								  case 0:
									  echo "启动";
									  break;
								  case 1:
									  echo "立即";
									  break;
								  case 2:
									  echo "定时";
									  break;
								  case 3:
									  echo "WIFI连接";
									  break;
								  default:
								  	  echo "未知";
								  }
							?>
							</td>
							<td><?php echo !empty($row['eventPoint']) ? $row['eventPoint'] : '&nbsp;';?></td>
							<td><?php echo !empty($row['note']) ? $row['note'] : '&nbsp;';?></td>
							
						</tr>
						<?php }?>
						</table>
				<?php 	} else{?>
						<div class="d-none">
						暂无数据！
						</div>
				<?php	 }?>
				
				</div>
				<div class="bi-data-tab" id="data-2" style="display:none;">
				<?php if(count($this->idDefineRows)>0){?>
						<table class="table reportTable">
						<tr class="subject">
							<td>页面id</td>
							<td>&nbsp;&nbsp;页面名称&nbsp;&nbsp;</td>
							<td>页面类型</td>
							<td>辅助参数</td>
							<td>说明</td>
							<td>当前是否埋点</td>
							<td>重要</td>
							<td>备注</td>
						</tr>
						<?php 
						foreach ($this->idDefineRows as $row){
						       if ($row['fieldType']=='C'){
						?>
						<tr class="dataLine  <?php if ($row['isUse']!=1){ echo 'del'; }?> <?php if ($row['isUserNow']==1){ echo 'isUserNow-Yes'; }else{echo 'isUserNow-No';}?>">
							<td><?php echo !empty($row['pageId']) ? $row['pageId'] : '&nbsp;';?></td>
							<td><?php echo !empty($row['childPageName']) ? $row['childPageName'] : '&nbsp;';?></td>
							<td><?php 
								if ($row['pageType']==0){
									echo "页面";
								} else if ($row['pageType']==1){
									echo "弹窗";
								} else{
									echo "未知";
								}
							?></td>
							<td><?php echo !empty($row['aidNote']) ? $row['aidNote'] : '&nbsp;';?></td>
							<td><?php echo !empty($row['note']) ? $row['note'] : '&nbsp;';?></td>
							<td class="<?php if ($row['isUserNow']==1){ echo 'green'; }?>"><?php 
								if ($row['isUserNow']==1){
									echo "√";
								} else{
									echo "×";
								}
							?></td>
							<td><?php 
								if ($row['isFlag']==1){
									echo "√";
								} else{
									echo "×";
								}
							?></td>
							<td><?php echo !empty($row['remark']) ? $row['remark'] : '&nbsp;';?></td>
						</tr>
						<?php }
						}
						?>
						</table>
				<?php 	} else{?>
						<div class="d-none">
						暂无数据！
						</div>
				<?php	 }?>
				</div>
				
				<div class="bi-data-tab" id="data-3" style="display:none;">
				<?php if(count($this->idDefineRows)>0){?>
						<table class="table reportTable">
						<tr class="subject">
							<td>操作id</td>
							<td>&nbsp;&nbsp;操作名称&nbsp;&nbsp;</td>
							<td>辅助参数</td>
							<td>说明</td>
							<td>当前是否埋点</td>
							<td>重要</td>
							<td>备注</td>
						</tr>
						<?php foreach ($this->idDefineRows as $row){
						       if ($row['fieldType']=='A'){
						?>
						<tr class="dataLine  <?php if ($row['isUse']!=1){ echo 'del'; }?> <?php if ($row['isUserNow']==1){ echo 'isUserNow-Yes'; }else{echo 'isUserNow-No';}?>">
							<td><?php echo !empty($row['pageId']) ? $row['pageId'] : '&nbsp;';?></td>
							<td><?php echo !empty($row['childPageName']) ? $row['childPageName'] : '&nbsp;';?></td>
							<td><?php echo !empty($row['aidNote']) ? $row['aidNote'] : '&nbsp;';?></td>
							<td><?php echo !empty($row['note']) ? $row['note'] : '&nbsp;';?></td>
							<td class="<?php if ($row['isUserNow']==1){ echo 'green'; }?>"><?php 
								if ($row['isUserNow']==1){
									echo "√";
								} else{
									echo "×";
								}
							?></td>
							<td><?php 
								if ($row['isFlag']==1){
									echo "√";
								} else{
									echo "×";
								}
							?></td>
							<td><?php echo !empty($row['remark']) ? $row['remark'] : '&nbsp;';?></td>
						</tr>
						<?php }
						}
						?>
						</table>
				<?php 	} else{?>
						<div class="d-none">
						暂无数据！
						</div>
				<?php	 }?>
				</div>
				
				<div class="bi-data-tab" id="data-4" style="display:none;">
				<?php if(count($this->pageIdRows)>0){?>
						<table class="table reportTable">
						<tr class="subject">
							<td>页面id</td>
							<td>&nbsp;&nbsp;页面名称&nbsp;&nbsp;</td>
							<td>页面类型</td>
							<td>当前是否埋点</td>
							<td>重要</td>
							<td>说明</td>
							<td>备注</td>
						</tr>
						<?php 
						foreach ($this->pageIdRows as $row){
						?>
						<tr class="dataLine  <?php if ($row['isUserNow']==1){ echo 'isUserNow-Yes'; }else{echo 'isUserNow-No';}?>">
							<td><?php echo !empty($row['pageId']) ? $row['pageId'] : '&nbsp;';?></td>
							<td><?php echo !empty($row['pageName']) ? $row['pageName'] : '&nbsp;';?></td>
							<td><?php 
								if ($row['pageType']==0){
									echo "页面";
								} else if ($row['pageType']==1){
									echo "弹窗";
								} else{
									echo "未知";
								}
							?></td>
							<td class="<?php if ($row['isUserNow']==1){ echo 'green'; }?>"><?php 
								if ($row['isUserNow']==1){
									echo "√";
								} else{
									echo "×";
								}
							?></td>
							<td><?php 
								if ($row['isFlag']==1){
									echo "√";
								} else{
									echo "×";
								}
							?></td>
							<td><?php echo !empty($row['note']) ? $row['note'] : '&nbsp;';?></td>
							<td><?php echo !empty($row['remark']) ? $row['remark'] : '&nbsp;';?></td>
						</tr>
						<?php
						}
						?>
						</table>
				<?php 	} else{?>
						<div class="d-none">
						暂无数据！
						</div>
				<?php	 }?>
				</div>
				
				
				
				
				
				
				<div  class="d-note">
				
				</div>
				<!--content end-->
			</div>
		</div>
</div>
<script language="javascript">
function showData(flag){
	$(".bi-data-tab").hide();
	$("#data-"+flag).show();
	//del Default
	$('#content .d-title a').removeClass('on');
	$("#content .d-title #title-"+flag).addClass('on');
}

function setShowData(){
    var isUseNow = $("#isUserNow").val();
	if (isUseNow=='yes'){
	    $(".isUserNow-No").hide();
		$(".isUserNow-Yes").show();
	} else if (isUseNow=='all'){
	    $(".isUserNow-No").show();
		$(".isUserNow-Yes").show();
	} else if (isUseNow=='no'){
	    $(".isUserNow-No").show();
		$(".isUserNow-Yes").hide();
	}
	
}
</script>
</body>
</html>